﻿using Bids.Core.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.OpenAccess;
using Telerik.OpenAccess.Metadata;
using Telerik.OpenAccess.Metadata.Fluent;
namespace Bids.Core.DomainObjects
{
	/// <summary>
	/// 结算
	/// </summary>
	[Serializable]
    public class Settle : IEntity
	{
		
		/// <summary>
		/// 
		/// </summary>
        public virtual int ID { set; get; }
		/// <summary>
		/// 
		/// </summary>
        public virtual int DesignerId { set; get; }
		/// <summary>
		/// 
		/// </summary>
        public virtual int EmployerId { set; get; }
		/// <summary>
		/// 
		/// </summary>
        public virtual int ContributionId { set; get; }
		/// <summary>
		/// 
		/// </summary>
        public virtual decimal Amount { set; get; }
		/// <summary>
		/// 
		/// </summary>
        public virtual DateTime SettleTime { set; get; }
		/// <summary>
		/// 
		/// </summary>
        public virtual int TaskId { set; get; }
		/// <summary>
		/// 结算类型：初稿金，最终奖金
		/// </summary>
        public virtual int SettleType { set; get; }

        public static MappingConfiguration<Settle> CreateConfiguration()
        {
            var threadMapping = new MappingConfiguration<Settle>();
            threadMapping.MapType(t => new
            {
                t.ID,
                t.DesignerId,
                t.EmployerId,
                t.ContributionId,
                t.Amount,
                t.SettleTime,
                t.TaskId,
                t.SettleType
            }).ToTable("Settle");
            threadMapping.HasProperty(t => t.ID).IsIdentity(KeyGenerator.Autoinc);
            return threadMapping;
        }
	}
    public enum SettleTypes
    {
        初稿费 = 1,
        截稿奖金 = 2
    }
}

